﻿import request from '../../../../utils/unirequest';
import type { AxiosResponse } from '../../../../type/common';
import type { IAddParams, IAddResponse, ISearchParams, ISearchResponse, IDetailsResponse, ISysGroupsResponse } from './interface';


export default function SysVisitorReasonApi() {
  // 访客预约记录接口
  return {
    // 访客预约记录列表
    search: (data: ISearchParams): Promise<AxiosResponse<ISearchResponse[]>> => request.post("/api/SysVisitorRecordRequestBill/Search", data),
    // 访客预约添加
    add: (data: IAddParams): Promise<IAddResponse> => request.post("/api/SysVisitorRecordRequestBill/Add", data),
    // 访客预约记录详情
    details: (id: string): Promise<IDetailsResponse> => request.get(`/api/SysVisitorRecordRequestBill/${id}`),
    // 部门列表
    getSysGroups: (): Promise<ISysGroupsResponse[]> => request.get("/api/SysVisitorRecordRequestBill/GetSysGroups"),
    // 获取单据编码
    getCode: (): Promise<AxiosResponse> => request.get("/api/SysVisitorRecordRequestBill/PredictCode"),
  };
}

